Skip to content

Refactor the DirectionalNavigationAdapter #592

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 15, 2025

Conversation

mickael-menu
Copy link
Member

  • Refactored the DirectionalNavigationAdapter configuration option.
  • Added a configuration option to select the type of pointers that can turn pages.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the DirectionalNavigationAdapter to support a configurable pointer-based navigation system while updating related tap/key handling in the visual reader.

  • Updated VisualReaderViewController to use the new pointer configuration and observer event types.
  • Modified PointerEvent to conform to CaseIterable.
  • Refactored DirectionalNavigationAdapter to introduce PointerPolicy and KeyboardPolicy while deprecating older parameters.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
TestApp/Sources/Reader/Common/VisualReaderViewController.swift Updated adapter instantiation and changed event observers from tap to activate.
Sources/Navigator/Input/Pointer/PointerEvent.swift Added CaseIterable conformance to PointerType.
Sources/Navigator/DirectionalNavigationAdapter.swift Refactored configuration options (PointerPolicy and KeyboardPolicy), updated binding logic, and deprecated older initializer.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the DirectionalNavigationAdapter by updating its configuration options and enhancing pointer and keyboard policies. Key changes include:

  • Changing observer event types in VisualReaderViewController from .tap to .activate.
  • Updating PointerType to conform to CaseIterable.
  • Reorganizing the DirectionalNavigationAdapter with new PointerPolicy and KeyboardPolicy structures and deprecating the old TapEdges initializer.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
TestApp/Sources/Reader/Common/VisualReaderViewController.swift Updated pointer event observers to use .activate instead of .tap, aligning with the new pointer policy.
Sources/Navigator/Input/Pointer/PointerEvent.swift Extended PointerType with CaseIterable for easier pointer type iteration.
Sources/Navigator/DirectionalNavigationAdapter.swift Refactored configuration by introducing PointerPolicy and KeyboardPolicy, with adjustments to initializer logic and deprecation of old TapEdges.
Comments suppressed due to low confidence (1)

TestApp/Sources/Reader/Common/VisualReaderViewController.swift:89

  • The change from .tap to .activate should be thoroughly verified to ensure it aligns with the intended pointer event handling defined in the new PointerPolicy. Consider confirming that all affected event behaviors are consistent with the adapter’s updated configuration.
navigator.addObserver(.activate { [weak self] _ in

@mickael-menu mickael-menu force-pushed the fix/directional-adapter branch from 03ce40d to bd618a8 Compare May 15, 2025 14:56
@mickael-menu mickael-menu merged commit 3be8076 into develop May 15, 2025
5 checks passed
@mickael-menu mickael-menu deleted the fix/directional-adapter branch May 15, 2025 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant